package com.teach;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.protocol.HTTP;
import org.apache.http.util.EntityUtils;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.teach.R;
import com.teach.downclass.teacher.TeacherDownClassActivity;
import com.teach.onclass.teacher.TeacherUpClassActivity;

public class TeacherMainActivity extends Activity {

	public static long upClassGroupId;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_teachermain);

		// TextView teacher_name = (TextView) findViewById(R.id.teacher_name);
		// getPGroupData();

		Button up = (Button) findViewById(R.id.teacher_up_class);
		UpButtonListener upbl = new UpButtonListener();
		up.setOnClickListener(upbl);

		Button down = (Button) findViewById(R.id.teacher_down_class);
		DownButtonListener downbl = new DownButtonListener();
		down.setOnClickListener(downbl);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	class UpButtonListener implements OnClickListener {

		@Override
		public void onClick(View v) {
			Intent upClassSltClsIntent = new Intent();
			ShowClasssActivity.currentOperation = ShowClasssActivity.ON_CLASS_OP;
			upClassSltClsIntent.setClass(TeacherMainActivity.this,
					ShowClasssActivity.class);
			startActivity(upClassSltClsIntent);
		}
	}

	class DownButtonListener implements OnClickListener {

		@Override
		public void onClick(View v) {
			Intent downClassIntent = new Intent();
			downClassIntent.setClass(TeacherMainActivity.this,
					TeacherDownClassActivity.class);
			startActivity(downClassIntent);
		}
	}
}
